﻿using System;
using System.Collections.Generic;
using System.Text;

using Daybreak.Core.Terrains;
using Daybreak.Core.Rendering;
using Microsoft.Xna.Framework;

namespace Daybreak.Core.SceneGraph
{
    public class TerrainNode : Node, IRenderable
    {
        ITerrain _terrain;

        public TerrainNode(ITerrain terrain)
        {
            _terrain = terrain;
        }

        public override void Accept(NodeVisitor visitor)
        {
            visitor.VisitTerrain(this);
        }

        public void UpdateTerrain(Camera camera)
        {
            _terrain.Update(camera);
        }

        #region IRenderable Members

        public void RenderSelf(IRender render, ref RenderArgs args)
        {
            _terrain.RenderSelf(render);
        }

        #endregion

    }
}
